Skip to content

Update to tinkerbell/tinkerbell/api for API definitions; Upgrade controller-runtime, CAPI, Go version, and all direct deps: #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Aug 12, 2025

Conversation

jacobweinstock
Copy link
Member

@jacobweinstock jacobweinstock commented Jun 3, 2025

Description

Move to github.com/tinkerbell/tinkerbell/api: This is the new repo for all API definitions.

Upgrade all go.mod dependencies: This uses the latest version of controller-runtime and capi.

Fix kustomize files to remove deprecated fields: This gets Tilt and kustomize working properly. This was tested using the CAPT playground.

Why is this needed

Fixes: #

How Has This Been Tested?

Tested with the CAPT playground. Everything is successful. I tested with Tinkerbell stack v0.6.2 and the newest version, 0.19.3.
When using the Tinkerbell stack v0.6.2, the CAPT controller logs show some warning log lines. These do not impact operations. This is happening because the new Hardware object has a field (spec.auto) that is not a pointer, so it gets included.

{"level":"info","controller":"tinkerbellmachine","controllerGroup":"infrastructure.cluster.x-k8s.io","controllerKind":"TinkerbellMachine","TinkerbellMachine":{"name":"capt-playground-worker-a-b58xg-l9gr5","namespace":"tink"},"namespace":"tink","name":"capt-playground-worker-a-b58xg-l9gr5","reconcileID":"7a5e1b9f-6a1a-447d-a3ac-80a32ea2b1b7","v":0,"caller":"/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/warning_handler.go:64","time":"2025-08-11T23:26:21Z","message":"unknown field \"spec.auto\""}

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@jacobweinstock jacobweinstock added breaking-change Denotes a PR that introduces potentially breaking changes that require user action. do-not-merge Signal to Mergify to block merging of the PR. labels Jun 3, 2025
@jacobweinstock jacobweinstock changed the title Update to tinkerbell/tinkerbell/api for API definitions; Upgrade controller-runtime and capi: Update to tinkerbell/tinkerbell/api for API definitions; Upgrade controller-runtime, CAPI, Go version, and all direct deps: Jul 29, 2025
@jacobweinstock jacobweinstock removed breaking-change Denotes a PR that introduces potentially breaking changes that require user action. do-not-merge Signal to Mergify to block merging of the PR. labels Aug 8, 2025
@jacobweinstock jacobweinstock requested a review from Copilot August 11, 2025 23:33
Copilot

This comment was marked as outdated.

Move to github.com/tinkerbell/tinkerbell/api:

  This is the new repo for all API definitions.

Upgrade all go.mod dependencies:

  This uses the latest version of controller-runtime
  and capi.

Fix kustomize files to remove deprecated fields:

  This gets Tilt and kustomize working properly.
  This was tested using the CAPT playground.

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
Move to a string instead of the deprecated
capierrors.MachineStatusError.
predicates.ClusterPausedTransitionsOrInfrastructureReady
is the suggested function to use instead of the
deprecated predicates.ClusterUnpausedAndInfrastructureReady.

Signed-off-by: Jacob Weinstock <[email protected]>
The compatibility is being moved to each
release. This is to help with keeping up
the list.

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
Renaming to isoboot makes this mode
name in line with netboot.

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
This gets the project to the latest
Tinkerbell, CAPI, and controller runtime
versions.

Signed-off-by: Jacob Weinstock <[email protected]>
The Tinkerbell CAPT playground has a command
for performing the pivot process. This
doc update details this process some.

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
The only change is the annotation denoting
the kubebuilder version.

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
This gets the controller to work with the
Helm charts <= 0.6.2

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
This is needed for backward compatibility
with Chart <= 0.6.2

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot August 12, 2025 15:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the cluster-api-provider-tinkerbell to use the new centralized API definitions from github.com/tinkerbell/tinkerbell/api and upgrades all dependencies including controller-runtime, CAPI, and Go version. It also fixes deprecated kustomize configurations to work with modern tooling.

  • Move API imports from separate tink and rufio repos to unified tinkerbell/api
  • Upgrade Go from 1.23 to 1.24 and update all dependencies to latest versions
  • Fix kustomize configurations by replacing deprecated fields with modern syntax

Reviewed Changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
main.go Updated imports and scheme registration for new API structure
go.mod Upgraded Go version and all dependencies to latest versions
controller/ Updated all imports to use new unified API packages
config/ Modernized kustomize configurations replacing deprecated syntax
api/v1beta1/ Added new boot mode constants and updated webhook interfaces
Makefile Updated tool versions and Go version references

@@ -143,22 +143,26 @@ func (scope *machineReconcileScope) reconcile(hw *tinkv1.Hardware) error {
return fmt.Errorf("ensure template and workflow returned: %w", err)
}

if wf.Status.State == tinkv1.WorkflowStateFailed || wf.Status.State == tinkv1.WorkflowStateTimeout {
// STATE_* is needed for Helm charts <= 0.6.2
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This comment suggests temporary backward compatibility code. Consider adding a TODO or tracking issue to remove this compatibility code when support for older Helm charts is dropped.

Suggested change
// STATE_* is needed for Helm charts <= 0.6.2
// TODO: Remove STATE_* compatibility when support for Helm charts <= 0.6.2 is dropped. See https://github.com/tinkerbell/cluster-api-provider-tinkerbell/issues/XXX

Copilot uses AI. Check for mistakes.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock added the ready-to-merge Signal to Mergify to merge the PR. label Aug 12, 2025
@mergify mergify bot merged commit 5bb1e3a into tinkerbell:main Aug 12, 2025
12 checks passed
@jacobweinstock jacobweinstock deleted the new-tinkerbell branch August 12, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant